<?php

namespace App\Base\Providers;

use App\Base\Contracts\AreaInterface;
use App\Base\Contracts\PublicInterface;
use App\Base\Repositories\DbAreaRepository;
use App\Base\Repositories\DbPublicRepository;
use App\Content\Providers\ContentServiceProvider;
use App\FreeBird\Providers\FreeBirdServiceProvider;
use App\Pay\Providers\PayProvider;
use App\Shop\Providers\GoodsProvider;
use App\Weixin\Providers\WeixinServiceProvider;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        require __DIR__.'/../routes.php';
    }

    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        $this->app->register(GoodsProvider::class);  //产品提供者
        $this->app->register(PayProvider::class);  //支付提供者
        $this->app->register(WeixinServiceProvider::class);  //微信提供者
        $this->app->register(ContentServiceProvider::class);  //微信提供者
        $this->app->register(FreeBirdServiceProvider::class);  //互程小程序，发布方与接单方


        $this->app->bind(PublicInterface::class, DbPublicRepository::class); //后台菜单
        $this->app->bind(AreaInterface::class, DbAreaRepository::class); //地址管理
    }
}
